﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IR
{
    class Document : IComparable<Document>, ICloneable
    {
        int m_Doc_number;
        double m_Docs_Length;
     
        double m_Priority;
        string m_preview;
        string m_path;


        public string Path
        {
            get { return m_path; }
            set { m_path = value; }
        }
        public string Preview
        {
            get { return m_preview; }
            set { m_preview = value; }
        }
        
        

        public int Doc_number
        {
            get { return m_Doc_number; }
            set { m_Doc_number = value; }
        }

        public double Docs_Length
        {
            get { return m_Docs_Length; }
            set { m_Docs_Length = value; }
        }
      
        public double Priority
        {
            get { return m_Priority; }
            set { m_Priority = value; }
        }


        public Document(int doc_number)
        {
            m_Doc_number = doc_number;
            m_Docs_Length = 0;
        }
        public Document(int doc_number, double doc_lengh, double priority, string preview, string path)
        {
            m_Doc_number = doc_number;
            m_Docs_Length= doc_lengh;
            m_Priority = priority;
            m_preview = preview;
            m_path = path;

        }

        public int CompareTo(Document other)
        {
            return m_Priority.CompareTo(other.m_Priority);
        }

        #region ICloneable Members

        public object Clone()
        {
            return new Document(this.m_Doc_number, this.m_Docs_Length, this.m_Priority, this.m_preview, this.m_path);
            
        }

        #endregion
    }
    class DocumentsList : List<Document>, ICloneable
    {
        public DocumentsList()
        {
            
        }

        public Object Clone()
        {
            DocumentsList dl = new DocumentsList();
            foreach (Document d in this)
            {
                dl.Add((Document)d.Clone());

            }
            return dl;
        }

    }

}
